﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Imaginecup.factory;
using Imaginecup.stage;
using Microsoft.Xna.Framework;
using Imaginecup.shareData;
using Imaginecup.gameState.darkRain.stage;

namespace Imaginecup.gameState.darkRain.stageMan
{
    public class DarkRainStageFactory:IFactory
    {
        public Object GetObject(Object ID)
        {
            StageEnum stageEnum = (StageEnum)ID;
            switch( stageEnum )
            {
                case StageEnum.ChoiceStage:
                    SetHorizontalGraphic();
                    return ChoiceStage.GetChoiceStage();
                case StageEnum.Stage1:
                   // TestFactoryStage stage1 = new TestFactoryStage();
                    SetVerticalGraphic();
                    Stage1 stage1 = new Stage1();
                    return stage1;
            

            }
            return null;
        }

        private void SetVerticalGraphic()
        {
            GraphicsDeviceManager deviceMan = GraphicShareData.GetShareData().GetGraphicDeviceMan();

            deviceMan.SupportedOrientations = DisplayOrientation.Portrait;
            deviceMan.PreferredBackBufferHeight = 800;
            deviceMan.PreferredBackBufferWidth = 480;

            deviceMan.ApplyChanges();
        }

        private void SetHorizontalGraphic()
        {
            GraphicsDeviceManager deviceMan = GraphicShareData.GetShareData().GetGraphicDeviceMan();

            deviceMan.SupportedOrientations = DisplayOrientation.Default;

            deviceMan.PreferredBackBufferHeight = 480;
            deviceMan.PreferredBackBufferWidth = 800;
            deviceMan.ApplyChanges();
        }
    }
}
